package com.example.sid.ui.fragments.app_token

import android.widget.Button
import androidx.fragment.app.Fragment
import com.example.sid.R
import com.example.sid.ui.fragments.utils.navigateTo

/**
 * Проходной фрагмент разделяющий функционал фичи.
 */
class AppTokenRootFragment : Fragment(R.layout.fragment_app_token_root) {
	private val goToPartnerSsoWay: Button get() = requireView().findViewById(R.id.go_to_partner_sso_way)
	private val updateAppTokenWay: Button get() = requireView().findViewById(R.id.update_app_token_way)
	private val checkAndSubscribeWay: Button get() = requireView().findViewById(R.id.check_and_subscribe_way)

	override fun onStart() {
		super.onStart()
		goToPartnerSsoWay.setOnClickListener {
			navigateTo(AppTokenRootFragmentDirections.actionAppTokenRootFragmentToGoToPartnerSSOFragment())
		}
		updateAppTokenWay.setOnClickListener {
			navigateTo(AppTokenRootFragmentDirections.actionAppTokenRootFragmentToUpdateAppTokenFragment())
		}
		checkAndSubscribeWay.setOnClickListener {
			navigateTo(AppTokenRootFragmentDirections.actionAppTokenRootFragmentToCheckAndSubscribeAppTokenForValidFragment())
		}
	}
}